import request from '@/utils/request';


export async function fetchUserList(params) {
  return request(
    `/api/user?load=streets&page=1&limit=${params.limit}&offset=${params.offset}${params.search}`,
  );
}

export async function fetchStreets() {
  return request(`/api/street`);
}



export async function fetch(params) {
  return request(`/api/gateway?load=users&page=1&load=user&limit=${params.limit}&offset=${params.offset}${params.search}`);
}



export async function fetchOne(params) {
  return request(`/api/gateway?load=users&query=id:${params.Id}`);
}

export async function FetchUser() {
  return request(`/api/user`);
}

export async function FetchOneGateway(params) {
  return request(`/api/gateway?load=users&query=Id:${params.Id}`);
}



export async function DeleceGateway(params) {
  return request(`/api/gateway/${params.id}`, {
    method: 'DELETE',
    data: params,
  })
}


export async function AddGateway(params) {
  return request(`/api/gateway`, {
    method: 'POST',
    data: params,
  })
}


export async function UpdateGaeteway(params) {
  return request(`/api/gateway/${params.Id}`, {
    method: 'PUT',
    data: params,
  })
}